import time
import os

print(str(time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))))


class Test:
    choices = 1

    def __init__(self, name, age):
        self.name = name
        self.age = age

    def outline(self):
        return "you are {}, year is {}".format(self.name, self.age)

    @classmethod
    def update(cls, x):
        cls.choices = x * cls.choices

    @property
    def test_property(self):
        return "you are {}, year is {}".format(self.name, self.age)


a = Test('weakxy', 20)
print(a.choices)
print(Test.choices)
a.update(20)
print(a.choices)
print(Test.choices)
b = Test('杨梦菲', 19)
result1 = b.outline()
result2 = b.test_property
print(result1)
print(result2)

print(os.name)
print(os.environ['HOMEPATH'])
for i in os.walk("."):
    print(i)
print(os.listdir())
print(os.getcwd())


class MyException(Exception):
    pass


try:
    raise MyException("this")
except Exception as e:
    print(e)


dict_list = {'key1': 1, 'key2': 2}
ans = [value for value in dict_list.items()]
print(ans)
